clc; %清楚前面的指令
close all; %关闭matlab所有窗口
clear all; %清空工作区
lineA = [1,5;5,7;7,3;3,1];
lineB = [1,17;17,6;6,1];
point = load('D:\PythonWork\数学建模国赛算法准备\遗传算法\data.txt');
point = point(:,2:3);

A=zeros(31,31);
i=1;
while i<=4
X=lineA(i,1);
Y=lineA(i,2);
A(X,Y)=1;
A(Y,X)=1;
i=i+1;
end%创建坐标点的邻接矩阵
B=zeros(31,31);
i=1;
while i<=3
X=lineB(i,1);
Y=lineB(i,2);
B(X,Y)=1;
B(Y,X)=1;
i=i+1;
end%创建坐标点的邻接矩阵

gplot(A,point,'-*');
gplot(B,point,'-o');